<template>
  <div id="OrdersTitle">
    <v-details
      :inputConfig="inputConfig"
      :detailData="inputData"
      :rules="rules"
      ref="input"
    ></v-details>
  </div>
</template>

<script>
import details from 'commons/Detail'
import baseMixin from "@/mixins/BaseMixin";

export default {
  props: {
    inputData: {
      type: Object,
    }
  },
  mixins: [baseMixin],
  name: "OrdersTitle",
  data () {
    return {
      rules: {
        configkey: [
          { required: true, trigger: 'blur' },
        ],
        nsqldescrip: [
          { required: true, trigger: 'blur' },
        ]
      },
    }
  },
  computed: {
    inputConfig () {
      if (this.$parent.inputDataFlag == '1') {
        return [
          [
            {
              type: "input",
              label: this.$t('manage.configkey'),
              props: "configkey",
              disabled: true
            },
            {
              type: "input",
              label: this.$t('common.desc'),
              props: "nsqldescrip",
              disabled: true
            }
          ],
          [
            {
              type: "input",
              label: this.$t('manage.effective'),
              props: "effective",
              disabled: true
            },
            {
              type: "input",
              label: this.$t('app.default'),
              props: "nsqldefault",
              disabled: true
            },
          ],
          [
            {
              type: "select",
              label: this.$t('manage.open'),
              props: "effective",
              options: [
                { code: 'I', description: this.$t('code.yes') },
                { code: 'O', description: this.$t('code.no') }
              ]
            }
          ]
        ]
      } else {
        return [
          [
            {
              type: "input",
              label: this.$t('manage.configkey'),
              props: "configkey",
              disabled: true
            },
            {
              type: "input",
              label: this.$t('common.desc'),
              props: "nsqldescrip",
              disabled: true
            }
          ],
          [
            {
              type: "input",
              label: this.$t('manage.effective'),
              props: "nsqlvalue",
            },
            {
              type: "input",
              label: this.$t('app.default'),
              props: "nsqldefault",
              disabled: true
            },
          ],
        ]
      }

    },
  },
  methods: {},
  mounted () {
  },
  watch: {},
  components: {
    'v-details': details
  }
}
</script>

<style scoped>
</style>
